﻿
//

if (!window.Sigma){
	window.Sigma={};
}
Sigma.Msg=Sigma.Msg || {};
SigmaMsg=Sigma.Msg;

Sigma.Msg.Grid = Sigma.Msg.Grid || {};

Sigma.Msg.Grid.cn={
	LOCAL	: "CN",
	ENCODING		: "UTF-8",
	NO_DATA : "没有要展现的数据...",


	GOTOPAGE_BUTTON_TEXT: '跳转到指定的页',

	FILTERCLEAR_TEXT: "清除全部过滤条件",
	SORTASC_TEXT	: "升序排列",
	SORTDESC_TEXT	: "降序排列",
	SORTDEFAULT_TEXT: "清除排序状态",

	ERR_PAGENUM		: "跳转页数只能是 1 至 #{1} 的整数!",

	EXPORT_CONFIRM	: "处理全部数据吗?\n\n( \"取消\" 为处理当前页面)",
	OVER_MAXEXPORT	: "数据总数超过了所允许的最大值( #{1} 条 ).",

	PAGE_STATE	: "第 #{1} - #{2}条, 共 #{3}页 #{4}条数据",
	PAGE_STATE_FULL	: "第 #{5}页 #{1} - #{2}条, 共 #{3}页 #{4}条数据",

	SHADOWROW_FAILED: "无法取得相关信息",
	NEARPAGE_TITLE	: "",
	WAITING_MSG : '',

	NO_RECORD_UPDATE: "没有记录需要被更新.",
	UPDATE_CONFIRM	: "确定要执行保存操作吗?",
	NO_MODIFIED: "没有记录被更改,无需保存.",

	
	PAGE_BEFORE : '第',
	PAGE_AFTER : '页',

	PAGESIZE_BEFORE :   '每页',
	PAGESIZE_AFTER :   '条',

	RECORD_UNIT : '条',
	
	CHECK_ALL : '全选',

	COLUMNS_HEADER : '--列 名--',

	DIAG_TITLE_FILTER : '过滤选项',
	DIAG_NO_FILTER : '无过滤条件',
	TEXT_ADD_FILTER	: "添加条件",
	TEXT_CLEAR_FILTER	: "清除所有条件",
	TEXT_OK	: "确定",
	TEXT_DEL : "删除",
	TEXT_CANCEL	: "取消",
	TEXT_CLOSE	: "关闭",
	TEXT_UP : "上移",
	TEXT_DOWN : "下移",

	NOT_SAVE : "数据已修改,但未保存,要现在保存吗? \n 若点击\"取消\",未保存的信息将丢失.",

	DIAG_TITLE_CHART  : '图表',

	CHANGE_SKIN : "换肤",

	STYLE_NAME_DEFAULT : "默认蓝色风格",
	STYLE_NAME_PINK : "中国红风格",
	STYLE_NAME_VISTA : "vista风格",
	STYLE_NAME_MAC : "mac风格",

	MENU_FREEZE_COL : "锁定/解锁 列",
	MENU_SHOW_COL : "显示/隐藏 列",
	MENU_GROUP_COL : "编组/解除组 列",

	TOOL_RELOAD : "刷新" ,
	TOOL_ADD : "添加" ,
	TOOL_DEL : "删除" ,
	TOOL_SAVE : "保存" ,

	TOOL_PRINT : "打印" ,
	TOOL_XLS : "导出 xls" ,
	TOOL_PDF : "导出 pdf" ,
	TOOL_CSV : "导出 csv" ,
	TOOL_XML : "导出 xml",
	TOOL_FILTER : "过滤" ,
	TOOL_CHART : "图表" 

};

Sigma.Msg.Grid['default']=Sigma.Msg.Grid.cn;


if (!Sigma.Msg.Validator){
	Sigma.Msg.Validator={ };
}

Sigma.Msg.Validator.cn={

		'required'	: '{0#该项}是必填项目！',
		'date'		: '{0#该项}必须是正确的日期({1#YYYY-MM-DD})！',
		'time'		: '{0#该项}必须是正确时间({1#HH:mm})！',
		'datetime'	: '{0#该项}必须是正确的日期和时间({1#YYYY-MM-DD HH:mm})！',
		'email'		: '{0#该项}必须是正确的email格式！',
		'telephone'	: '{0#该项}必须是正确的电话号码！',
		'number'	: '{0#该项}必须是数字形式！',
		'integer'	: '{0#该项}必须是整数形式！',
		'float'		: '{0#该项}必须是整数或小数形式！',
		'money'		: '{0#该项}必须是整数或两位小数形式！',
		'range'		: '{0#该项}的范围必须要在{1}和{2}之间！',
		'equals'	: '{0#该项}必须与{1#另一项}相等！',
		'lessthen'	: '{0#该项}不能大于{1#另一项}！',
		'idcard'	: '{0#该项}必须是正确的身份证号码！',

		'enchar'	: '{0#该项}必须是普通英文字符：字母，数字和下划线。',
		'cnchar'	: '{0#该项}必须是中文字符。',
		'minlength'	: '{0#该项}的长度不能小于{1}个字符。',
		'maxlength'	: '{0#该项}的长度不能大于{1}个字符。'

};

Sigma.Msg.Validator['default'] = Sigma.Msg.Validator.cn;

//


//gtbase
var GtGrid1Action = "START";
function GetGturl(s) {
    return shUrlBase + "gridcmd.axd?DNA=" + (Math.random() * 100000).toString().substr(0, 6) + s; //  shUrlBase + "jqPlugin/sigma_grid/cs/gtGrid.aspx?DNA=" + (Math.random() * 100000).toString().substr(0, 6) + s;
};
function GetSigmaGridPath(s) {
    return shUrlBase + 'jqPlugin/sigma_grid/';
};
function num_renderer(value, record, columnObj, grid, colNo, rowNo) {
    var no = record[columnObj.fieldIndex];
    var color = no < 50 ? "red" : (no > 70 ? "green" : "blue");
    return "<span style=\"color:" + color + ";\"><strong>" + no + "</strong></span>";
};

var clopCheckBox = {  "False": "否" ,"True": "是"};
function clrdCheckBox(value, record, columnObj, grid, colNo, rowNo) {
    var options = clopCheckBox;
    var ret = options[value];
    if (ret == null) {
        ret = value;
    }
    if (ret == "否") { ret = ""; }
    return ret;
};
function GetGtSelectId(sid,sKeyFields) { 
    var grid = Sigma.$grid(sid);
    if (!sKeyFields) sKeyFields = grid.sKeyFields;
    var arrRow = grid.getSelectedRecords();
    var sRetId = "";
    if (arrRow != null && arrRow.length > 0) {
        for (i = 0; i < arrRow.length; i++) {
            if (sRetId.indexOf(arrRow[i][sKeyFields]) < 0) {
                sRetId += sRetId == "" ? arrRow[i][sKeyFields] : "," + arrRow[i][sKeyFields];
            }
        }
    }
    return sRetId;
};
function GetGtAllId(sid,sKeyFields) { 
    var grid = Sigma.$grid(sid);
    if (!sKeyFields) sKeyFields = grid.sKeyFields;
    var arrRow = grid.gridTable.rows; 
    var sRetId = "";
    if (arrRow != null && arrRow.length > 0) {
        for (i = 0; i < arrRow.length; i++) {
            var record = grid.getRecord(arrRow[i]);
            sRetId += sRetId == "" ? record[sKeyFields] : "," + record[sKeyFields];
        }
    }
    return sRetId;
};
function GetGtRecord(sid, sValue, sKeyFields) {
    var grid = Sigma.$grid(sid);
    if (!sKeyFields) sKeyFields = grid.sKeyFields;
    var rows = grid.gridTable.rows; 
    for (var i = 0; i < rows.length; i++) {
        var record = grid.getRecord(rows[i]);
        if (typeof (record) == "undefined") continue;
        if (record[sKeyFields] == sValue)
            return record;
    }return null;
};
function GetGtRowObj(sid, sValue, sKeyFields) {
    var grid = Sigma.$grid(sid);
    if (!sKeyFields) sKeyFields = grid.sKeyFields;
    var rows = grid.gridTable.rows; 
    for (var i = 0; i < rows.length; i++) {
        var record = grid.getRecord(rows[i]);
        if (typeof (record) == "undefined") continue;
        if (record[sKeyFields] == sValue)
            return rows[i];
    }return null;
};
function CheckGtRow(sid, sValue, blChecked,blOthChecked, sKeyFields) {
    sValue = "," + sValue + ",";
    var grid = Sigma.$grid(sid);
    if (!sKeyFields) sKeyFields = grid.sKeyFields;
    var grid = Sigma.$grid(sid);
    var rows = grid.gridTable.rows; 
    for (var i = 0; i < rows.length; i++) {
        var record = grid.getRecord(rows[i]);
        if (typeof (record) == "undefined") continue;
        if (record && record[sKeyFields] && sValue.indexOf(','+record[sKeyFields]+',') != -1)
            grid.checkRow(rows[i], blChecked);
        else if(blOthChecked!=null)
            grid.checkRow(rows[i], blOthChecked);
    }
};
function GetGtPreRecord(sid, sValue, sKeyFields) {
    var grid = Sigma.$grid(sid);
    if (!sKeyFields) sKeyFields = grid.sKeyFields;
    var rows = grid.gridTable.rows;
    for (var i = 1; i < rows.length; i++) {
        var record = grid.getRecord(rows[i]);
        if (typeof (record) == "undefined") continue;
        if (record[sKeyFields] == sValue)
            return grid.getRecord(rows[i-1]);
    } return null;
};
function GetGtNextRecord(sid, sValue, sKeyFields) {
    var grid = Sigma.$grid(sid);
    if (!sKeyFields) sKeyFields = grid.sKeyFields;
    var rows = grid.gridTable.rows;
    for (var i = 1; i < rows.length; i++) {
        var record = grid.getRecord(rows[i - 1]);
        if (typeof (record) == "undefined") continue;
        if (record[sKeyFields] == sValue)
            return grid.getRecord(rows[i]);
    } return null;
};
function DelGtRecord(sid, sValue, sKeyFields) {
    var grid = Sigma.$grid(sid);
    if (!sKeyFields) sKeyFields = grid.sKeyFields;
    if (grid.readOnly || grid.endEdit() === false) {
        return false;
    }
    var record = GetGtRecord(sid, sValue, sKeyFields);
    if (!record) return false; grid.deleteRow(grid.getRowByRecord(record)); return true;
};
function BoundCotrGt(sid, sValue, sDivId, sKeyFields) {
    var record = GetGtRecord(sid, sValue, sKeyFields);
    if (!record) return;
    BoundCotr(sDivId, record); 
    InitEditItemTxtChecked(sDivId)
};
function InitEditItemTxtChecked(sDivId) {
    $("#" + sDivId + " input[type='checkbox'][id^='ckbi']").each(function() {
        var regexp1 = new RegExp("[A-Z|0-9|_]{3,}");
        var regetem = this.id.match(regexp1);
        if (regetem != null) {
            if (regetem[0].substr(0, 3) == "CH_") {
                $(this).attr("checked", false);
            }
        }
    });
    if ($('#' + sDivId).attr("hasInitEditItemTxtChecked") === "true") { return; }    
    $('#' + sDivId+' input,select').change(function(event) {
        var regexp1 = new RegExp("[A-Z|0-9|_]{3,}");
        var regetem = this.id.match(regexp1);
        if (regetem != null) {
            var ckbidtem111 = $(this).attr('EditCheckForId') || "ckbiCH_" + regetem[0]; 
            if ($("#" + ckbidtem111).size() > 0) { $("#" + ckbidtem111).attr("checked", true); }
        }
    });
    $('#' + sDivId).attr("hasInitEditItemTxtChecked", "true");
};
function CngRowValue(sid, sValue, sDivId, sKeyFields, oRecordFrom) {
    if (sDivId != null && sDivId != '' && !$('#' + sDivId).validationEngine({ returnIsValid: true })) {
        return false;
    }
    var grid = Sigma.$grid(sid);
    if (grid.readOnly || grid.endEdit() === false) {
        return false;
    }
    var oRecordTo = GetGtRecord(sid, sValue, sKeyFields);
    if (!oRecordTo) return false;
    if (oRecordFrom == null) {
        oRecordFrom = GetFormJson(sDivId).arrjson;
    }
    for (m in oRecordTo) {
        if (oRecordFrom[m] == null || oRecordFrom['CH_' + m] === false) continue;
        SetRowValue(grid, grid.getRowByRecord(oRecordTo), m, oRecordFrom[m]);
    } return true;
};
function CngRowColValue(sid, sKeyId, sFields, sNewValue, sKeyFields) {
    var grid = Sigma.$grid(sid);
    if (grid.readOnly || grid.endEdit() === false) {
        return false;
    }
    var oRecordTo = GetGtRecord(sid, sKeyId, sKeyFields);
    if (!oRecordTo) return false;
    SetRowValue(grid, grid.getRowByRecord(oRecordTo), sFields, sNewValue);
};
function AddGtRow(sid, sKeyFields) {
    var grid = Sigma.$grid(sid);
    if (!sKeyFields) sKeyFields = grid.sKeyFields;
    if (grid.readOnly || grid.endEdit() === false) {
        return null;
    }
    var nRecord = grid.cloneDefaultRecord();
    nRecord[sKeyFields] = GetRadom(12);
    grid.addRow(nRecord, true);
    return nRecord;
}
function GetGtModified(sid, grid) {
    if (grid == null)
        grid = Sigma.$grid(sid);
    grid.endEdit();
    var _insert = grid.getInsertedRecords();
    var _update = grid.getUpdatedRecords();
    var _delete = grid.getDeletedRecords();
    var hasModified = (_insert && _insert.length > 0 || _update && _update.length > 0 || _delete && _delete.length > 0);
    return hasModified;
};
function doFinderGt(sid) {
    var grid = Sigma.$grid(sid);
    if (!grid || !grid.rendered) {
        return true;
    }
    if (GetGtModified(sid, grid)) {
        if (confirm("数据已发生改变，是否要保存？")) {
            grid.save(); return;
        } else {
            grid.saveSuccess();
        }
    } else {
//        grid.render();

        grid.reload(true);
    }
    grid.remoteFilter = true;
    grid.remotePaging = true;
    grid.remoteSort = true;
    grid.readOnly = true;
//    grid.refresh();
};
function doEditGt(sid) {
    var grid = Sigma.$grid(sid);
    if (!grid) {
        return true;
    }
    grid.readOnly = false;
    grid.startEdit();
    grid.remoteFilter = false;
    grid.remotePaging = false;
    grid.remoteSort = false;
};
function doCancelGt(sid) {
    var grid = Sigma.$grid(sid);
    if (!grid) {
        return true;
    }
    grid.reloadAfterSave = false;
    grid.saveSuccess();
    grid.reloadAfterSave = true;
    grid.readOnly = true;
    grid.remoteFilter = true;
    grid.remotePaging = true;
    grid.remoteSort = true;
//    grid.refresh();
};
var GtExectime1;
function doSaveGt(sid, isNotSetRS) {
    var grid = Sigma.$grid(sid);
    if (!grid || !grid.rendered) {
        return true;
    }
    grid.isAjaxCmp = false;
    if (GetGtModified(sid, grid)) {
        if (GetGtValid(sid)) {
            grid.isNotSetRS = isNotSetRS;
            grid.save();
        }
    } else {
        grid.isAjaxCmp = true;
        if (isNotSetRS) return;
        grid.reloadAfterSave = false;
        grid.saveSuccess();
        grid.reloadAfterSave = true;
//        grid.readOnly = true;
        grid.remoteFilter = true;
        grid.remotePaging = true;
        grid.remoteSort = true;
    }
};
function doAfterGtAct(response, grid, sAct) {
    var json = eval('[' + response.text + ']'); //eval("(" + data + ")");
    if (response.text && response.text.substring(0, 1) == '[') { json = eval('(' + response.text + ')'); }
    $.each(json, function(idx, item) {
        if (sAct == "save") {
            grid.isAjaxSuccess = true;
            if (item.success) {
                if (grid.isNotSetRS === true) {
                    grid.readOnly = true;
                }
                grid.remoteFilter = true;
                grid.remotePaging = true;
                grid.remoteSort = true;
                grid.reload();
            } else {
                if (!!item.exception) {
                    grid.isAjaxSuccess = false; alert(item.exception);
                }
            }
            grid.isNotSetRS = false;
        } if (item == null) return;
        BoundByJson(item.jpanel, item.jrow);
        if (!!(item.jscrip)) { eval(item.jscrip); }
        if (item.jmsg != null && item.jmsg != "") { alert(item.jmsg); if (item.jmsg == "错误：用户未登录！") { ToLogin(); } }
    });

};
function SetRowValue(grid,rowObj,scolNme,sNewValue) {
    var sOldValue = grid.getCellValue(scolNme, rowObj);//if (sNewValue == sOldValue) return;
    var record = grid.getRecord(rowObj);
    var cell = grid.getCell(rowObj, scolNme);
    grid.update(record, scolNme, sNewValue);
    grid.refreshRow(rowObj, record, cell);    
}
function GetGtValid(sid) {
    var blret = true;
    var grid = Sigma.$grid(sid);
    if (!grid.rendered) {
        return true;
    }
    if (grid.activeEditor && grid.activeEditor.locked === true
			|| (grid.activeDialog != grid.activeEditor) && grid.activeDialog && !grid.activeDialog.hidden
		) {
        return false;
    }
    if (grid.activeCell && grid.activeEditor && (grid.activeColumn.editable || grid.isInsertRow(grid.activeRow))) {
        if (grid.editing) {
            var row = grid.activeRow;
            var oldValue = grid.activeValue;
            var value = grid.activeEditor.parseValue(grid.activeEditor.getValue());
            var validResult = grid.validValue(grid.activeColumn, value, grid.activeRecord, grid.activeCell);
            if (validResult === true && String(grid.activeValue) !== String(value)) {
                blret = true;
                grid.updateRecordField(grid.activeCell, value);
                grid.refreshRow(row, grid.activeRecord);
                grid.dirty(grid.activeCell);
                grid.activeValue = value;
            } else {
                blret = validResult;
                return blret === true;
            }
        }

        if (grid.activeEditor && grid.activeEditor instanceof Sigma.Dialog) {

        } else {
            grid.gridEditorCache.appendChild(grid.activeEditor.getDom());
        }
        grid.activeEditor.hide();
        grid.editing = false;
        grid.syncTwinRowCell(null, grid.activeCell);
    }
    var _insert = grid.getInsertedRecords();
    var rows = grid.gridTable.tFoot ? grid.gridTable.tFoot.rows : [];
    for (var i = 0, len = _insert.length; i < len; i++) {
        var _ir = _insert[i];
        for (var cn = 0; cn < grid.columnList.length; cn++) {
            var colObj = grid.columnList[cn];
            if (colObj.editor) {
                var value = _ir[colObj.fieldIndex];
                var cell = rows[i] ? rows[i].cells[colObj.colIndex] : null;
                if (grid.validValue(colObj, value, _ir, cell) !== true) {
                    blret = false;
                }
            }
        }
    }
    var _update = grid.getUpdatedRecords();
    rows = grid.gridTable.tFoot ? grid.gridTable.tFoot.rows : [];
    for (var i = 0, len = _update.length; i < len; i++) {
        var _ir = _update[i];
        for (var cn = 0; cn < grid.columnList.length; cn++) {
            var colObj = grid.columnList[cn];
            if (colObj.editor) {
                var value = _ir[colObj.fieldIndex];
                var cell = rows[i] ? rows[i].cells[colObj.colIndex] : grid.getCell(grid.getRowByRecord(_ir), colObj.id);
                if (grid.validValue(colObj, value, _ir, cell) !== true) {
                    blret = false;
                }
            }
        }
    }
    return blret === true;
};
function gtSortNum(value, record) {
    return Number(value);
};
function autogtResize(cBoxid, grid, pDivId, ppDivId, pppDivId) {
    if (!grid.isSetAutoSizeEven) {
        $(window).resize(function() {
            gtResize(cBoxid, grid, pDivId, ppDivId, pppDivId);
            grid.isSetAutoSizeEven = true;
        });
    }
    gtResize(cBoxid, grid, pDivId, ppDivId, pppDivId);
};
function gtResize(cBoxid, grid, pDivId, ppDivId, pppDivId) {
    if (grid.bodyDiv) {

        var iiheighttm3 = $(window).height() - $(grid.gridDiv).offset().top;
        if (grid.minheight != null && grid.minheight > 0 && iiheighttm3 < grid.minheight) {
            iiheighttm3 = grid.minheight;
        }
        $(grid.gridDiv).height(iiheighttm3);
        $(grid.bodyDiv).height(iiheighttm3-($(grid.bodyDiv).offset().top - $(grid.gridDiv).offset().top));
        grid.height = iiheighttm3;
        grid._onResize();
    }
};
function gtvalidatortime(value, record, colObj, grid) {
    var regexp1 = new RegExp(/^(20|21|22|23|[01]\d|\d)(([:][0-5]\d){1,2})$/);
    if (value != '' && !regexp1.test(value)) {
        return "必须输入时间，如：14:59";
    }
    return true;
};
function gtvalidatorip(value, record, colObj, grid) {
    var regexp1 = new RegExp("^(([1-9][0-9]?|1[0-9]{2}|2[0-5][0-9]).)(([0-9]{1,2}|1[0-9]{2}|2[0-5][0-9]).){2}([0-9]{1,2}|1[0-9]{2}|2[0-5][0-9])$");
//    var regexp1 = new RegExp("(([1]?[0-9]?[0-9]\.)|(2[0-5][0-5]\.))(([1]?[0-9]?[0-9]\.)|(2[0-5][0-5]\.))(([1]?[0-9]?[0-9]\.)|(2[0-5][0-5]\.))(([1]?[0-9]?[0-9])|(2[0-5][0-5]))");
    if (value != '' && !regexp1.test(value)) {
        return "必须输入IP，如：255.255.255.255";
    }
    return true;
};
function gtvalidatorcntr(value, record, colObj, grid) {
    if (value) {
        var sssstem1 = GetCntr(value); 
        if (sssstem1!==true) {
            if (confirm("箱号" + value + "未通过校验，请确认是否要录入？")) {
                return true;
            } else {
                return false;
            }
        }
    }
    return true;
};
function gtvalidatornumber(value, record, colObj, grid) {
    value = Number(value);
    if (!isNaN(value) ) {
        return true;
    }
    return "Number accepted only";
};
var setdounmaskoutt = null;
function domask(grid) {
//    grid.isShowMasking = true; setdounmaskoutt = null;
//    setdounmaskoutt=setTimeout(function () { if (grid.isShowMasking !== false) { ShowMask({ msg: '正在获取数据，请等待...' }); } }, 2000);
   
//    $(document.body).mask("Waiting...");
//    $(document.documentElement).mask("Waiting...");
};
function dounmask(grid) {
//    grid.isShowMasking = false;
//    HideMask();
//    $(document.body).unmask();
};
function gtAddDocSeclListItem(gtGridCid,sValueFid,sTextFid) {
    var sidtem1 = GetGtSelectId(gtGridCid, sValueFid);
    if (sidtem1) {
        var sidtem2 = GetGtSelectId(gtGridCid, sTextFid);
        AddDocSeclListItem( sidtem1, sidtem2);
    } else {
        alert("请先选择记录！");
    }
};
function getGtOp(gtGridCid, colsOption1111, container111, _keyFields, aParams) {

    var gridOption1tttttt = {
        id: gtGridCid,
        width: "100%",  //"100%", // 99%,
        height: "100%",  //"100%", // 330,
        minheight: null,
        bottomHeight: 0,
        loadURL: GetGturl('&p=load'),
        saveURL: GetGturl('&p=save'),
        exportURL: GetGturl('&export=true'),
        exportFileName: gtGridCid,
        showIndexColumn: false,
        container: container111,
        replaceContainer: true,
        columns: colsOption1111,
        showGridMenu: false,
        allowCustomSkin: true,
        selectRowByCheck: true,
        allowGroup: true,
        allowHide: true,
        transparentMask: false,
        stripeRows: true,
        remoteSort: true,
        remotePaging: true,
        remoteFilter: true,
        gridMask: false,
        skin: 'mac',
        respRetTem: '',
        respRetActTem: '',
        sKeyFields: _keyFields,
        isAjaxCmp: true,
        isAjaxSuccess: true,
        isSetAutoSizeEven: false,
        clickStartEdit: true,
        pageSize: 50,
        custbeforeInsert: null,
        isNotSetRS: false,
        autogtResize: true,
        //        reloadAfterSave: false,
        pageSizeList: [5, 10, 20, 50, 100, 200, 300, 500, 1000, 2000, 4000, 8000],
        encoding: 'UTF-8', // Sigma.$encoding(),
        toolbarPosition: 'top', // 'top', bottom 工具条显示的位置, 暂时不支持上下都显示.
        showTool: true,
        toolbarContent: 'nav goto | pagesize | add del | filter | state', //csv xls xml pdf chart 
        autoLoad: true,
        SigmaGridPath: GetSigmaGridPath(),
        onMouseOver: function (value, record, cell, row, colNo, rowNo, columnObj, grid) {
            if (columnObj && columnObj.toolTip && value) {
                grid.showCellToolTip(cell, columnObj.toolTipWidth); // grid.bodyDiv.offsetWidth-100
            } else {
                grid.hideCellToolTip();
            }
            if (aParams && aParams.onMouseOver) { aParams.onMouseOver(value, record, cell, row, colNo, rowNo, columnObj, grid); }
        },
        onMouseOut: function (value, record, cell, row, colNo, rowNo, columnObj, grid) {
            grid.hideCellToolTip();
            if (aParams && aParams.onMouseOut) { aParams.onMouseOut(value, record, cell, row, colNo, rowNo, columnObj, grid); }
        },
        beforeLoad: function (requestParameter) {
            if (GetGtModified('', this)) { return false; }
            var jsParam = GetGtParam(this.id); if (jsParam && pgtype) { jsParam.arrjson["PPAGE"] = pgtype; }; if (jsParam && sCurrRadom) { jsParam.arrjson["sRadom"] = sCurrRadom; }
            requestParameter["JSPARAM"] = jsParam.GetStr();
            domask(this);
        },
        beforeExport: function (type, fileName, url, name, action, grid) {
            var jsParam = GetGtParam(this.id); if (jsParam && pgtype) { jsParam.arrjson["PPAGE"] = pgtype; }; if (jsParam && sCurrRadom) { jsParam.arrjson["sRadom"] = sCurrRadom; }
            this.parameters["JSPARAM"] = jsParam.GetStr();
        },
        //        compResponseHandler: function(response, requestParameter, action) {
        //            respRetTem = response; respRetActTem = action;
        //            var pageInfo = this.getPageInfo(); if (pageInfo.totalRowNum == -1) pageInfo.totalRowNum = 0;
        //            $('#' + this.gridDiv.id).unmask();
        //        },
        saveResponseHandler: function (response, requestParameter) {
            try {
                doAfterGtAct(response, this, "save");
            }
            catch (e) { alert(e.message); }
            this.isAjaxCmp = true;
            dounmask(this);
        },
        loadResponseHandler: function (response, requestParameter) {
            this.respRetTem = response; this.respRetActTem = 'load';
            var pageInfo = this.getPageInfo(); if (pageInfo.totalRowNum == -1) pageInfo.totalRowNum = 0;
            //            $('#' + this.gridDiv.id).unmask();
        },
        onComplete: function (grid) {
            var ddddrespRetTem = this.respRetTem; this.respRetTem = ''; var ddddrespRetActTem = this.respRetActTem; this.respRetActTem = '';
            try {
                if (ddddrespRetTem && ddddrespRetActTem == 'load') { doAfterGtAct(ddddrespRetTem, this, ddddrespRetActTem); dounmask(this); }
            }
            catch (e) { alert(e.message); dounmask(this); } try { grid._onResize(); if (grid.autogtResize === true) gtResize(null, grid); } catch (e) { }
        },
        beforeSave: function (requestParameter) {
            var jsParam = GetGtParam(this.id); if (jsParam && pgtype) { jsParam.arrjson["PPAGE"] = pgtype; }; if (jsParam && sCurrRadom) { jsParam.arrjson["sRadom"] = sCurrRadom; }
            requestParameter["JSPARAM"] = jsParam.GetStr();
            domask(this);
        },
        afterSave: function (respD, success, gtGridcurr) {
        },
        customRowAttribute: function (record, rn, grid) {
            //                    return 'style="height:40px"';
        },
        beforeInsert: function (Data) {
            //            var pageInfo = this.getPageInfo();
            //            Data[this.sKeyFields] = GetRadom(8);
            if (this.custbeforeInsert != null) { this.custbeforeInsert(Data); }
            //	           Data.SEQ_NUM = pageInfo.totalRowNum + 1;
            //	           Data.IS_RIGHT = "False";
        }
        //        onCellClick: function(value, record, cell, row, colNO, rowNO, columnObj, grid) {
        //            if (columnObj.isCheckColumn !== true) return;
        //            if (!Sigma.Grid.isSelectedRow(row) && grid.getSelectedRecords().length > 0)
        //                Sigma.U.remove(grid.selectedRows, row); //从选中集中去除当前行
        //        },
        //        onHeadClick: function(event, headCell, colObj, grid) {
        //            if (colObj.isCheckColumn == true) {
        //                var $_headerobj = $(colObj.headCell).find("input[type='checkbox']");
        //                if ($_headerobj.length > 0) {
        //                    var arrRow = grid.getRows();
        //                    if ($_headerobj.attr("checked") == true || $_headerobj.attr("checked")=='checked') {
        //                        if (arrRow != null && arrRow.length > 0) {
        //                            for (i = 0; i < arrRow.length; i++) {
        //                                grid.checkRow(arrRow[i], true);
        //                            }
        //                        }
        //                    } else {
        //                        if (arrRow != null && arrRow.length > 0) {
        //                            for (i = 0; i < arrRow.length; i++) {
        //                                grid.checkRow(arrRow[i], false);
        //                            }
        //                        }
        //                    }
        //                }
        //            }
        //        }
    };
    return gridOption1tttttt;
};